<?php get_header(); ?>
<div class="row" id="main-row">
    <div id="equalheight" class="mikubox">
  <?php get_sidebar(); ?> 
  <div class="col-md-9 col-sm-9 main-col">
  <main>
	<header class="entry-header">
		<?php 
		$category = get_the_category();
		if(isset($category[0])): 
		?>
		<a class="category-tag" href="<?php echo get_category_link($category[0]->term_id ); ?>">
			<div class="tooltip left tooltip-display" role="tooltip">
				<div class="tooltip-arrow"></div>
				<div class="tooltip-inner">
					<?php echo $category[0]->cat_name; ?>
				</div>
			</div>
		</a>
		<?php endif; ?>
		<?php
			// if ( is_single() ) :
			// 	the_title( '<h3 class="entry-title">', '</h3>' );
			// else :
				the_title( sprintf( '<h4 class="entry-title"><a href="%s" rel="bookmark"><strong>&nbsp', esc_url( get_permalink() ) ), '</strong></a></h4>' );
			// endif;
		?>
        <div class="post-properties" style="float:clear">
				<span> <i class="glyphicon glyphicon-user"></i> <a target="_blank" href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ) ?>"><?php echo get_the_author() ?></a></span>
				<span> <i class="glyphicon glyphicon-time"></i> <?php echo timeago( get_gmt_from_date(get_the_time('Y-m-d G:i:s')) ) ?></span>
				<span> <i class="glyphicon glyphicon-fire"></i> <?php deel_views('℃'); ?></span>
				<span> <i class="glyphicon glyphicon-comment"></i>
				<?php if ( comments_open() ) 
				comments_popup_link( __( '暂无评论', 'huaji-pro' ));
				?>
				</span>
                
                <?php edit_post_link( __( '编辑', 'huaji-pro' ), '<span><i class="glyphicon glyphicon-edit"></i>', '</span>' ); ?>
	    </div>
	</header>
	<div class="entry-content container-fluid single-content">
		<?php
			the_content( sprintf(
				__( '继续阅读 %s', 'huaji-pro' ),
				the_title( '<span class="screen-reader-text">', '</span>', false )
			) );
		?>
		<blockquote>责任声明：本站一切资源均原创或收集自互联网，仅作交流学习之用，请勿用作商业行为!如造成任何后果，本站概不负责!</blockquote>
	</div>
    <?php
        the_posts_pagination( array(
                    'prev_text'          => __( '上一页', 'huaji-pro' ),
                    'next_text'          => __( '下一页', 'huaji-pro' )
            ) );
    ?>
    <?php
		// Author bio.
		if ( is_single() && get_the_author_meta( 'description' ) ) :
			get_template_part( 'author-bio' );
		endif;
        if ( comments_open() || get_comments_number() ) :
			comments_template();
		endif;
        the_post_navigation( array(
				'next_text' => '<span class="meta-nav" aria-hidden="true"><span class="glyphicon glyphicon-chevron-right"></span>' 
				. __( '下一篇', 'huaji-pro' ) . '</span><br> ' .
					'<span class="screen-reader-text">' . __( 'Next post:', 'huaji-pro' ) . '</span> ' .
					'<span class="post-title">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;%title</span>',
				'prev_text' => '<span class="meta-nav" aria-hidden="true"><span class="glyphicon glyphicon-chevron-left"></span>'
				 . __( '上一篇', 'huaji-pro' ) . '</span><br> ' .
					'<span class="screen-reader-text">' . __( 'Previous post:', 'huaji-pro' ) . '</span> ' .
					'<span class="post-title">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;%title</span>',
			) );
	?>
	<h5>同类文章:</h5>
    <ul class="cat_related">
        <?php
        global $post;
        $cats = wp_get_post_categories($post->ID);
        if ($cats) {
            $args = array(
                'category__in' => array( $cats[0] ),
                'post__not_in' => array( $post->ID ),
                'showposts' => 6
            );
        query_posts($args);
        if (have_posts()) {
            while (have_posts()) {
            the_post(); update_post_caches($posts); ?>
        <li><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></li>
        <?php
            }
        }
        wp_reset_query();
        }
        ?>
    </ul>
  </main>
  </div>
  </div>
</div>
<?php get_footer(); ?>